CC    = gcc
#C++   = /usr/local/intel/cce/10.1.015/bin/icc
C++   = gcc
CPP   = gcc
#DEBUG="ON"
IOPT = -I. -I /usr/local/include
LOPT = -L /usr/local/lib 

CSRC= tifflib.c warpsol.cc  main.cc warpUtil.cc rms.cc
cmpobj  = tifflib.o warpsol.o warpUtil.o main.o
rmsobj  = tifflib.o warpsol.o rms.o
vignetteobj  = tifflib.o warpsol.o vignette.o

default: warpsol  

ifdef DEBUG
COPT = -g3 $(IOPT) -c -D_GLIBCXX_DEBUG -Wall
#COPT = -g3 $(IOPT) -c 
else
COPT = -c -O3 -funroll-loops -fomit-frame-pointer  $(IOPT)
endif

warpsol:	$(cmpobj)
	$(C++) -o warpsol $(cmpobj)  $(LOPT) -lstdc++ -ljasper -ltiff -lpthread

rms:	$(rmsobj)
	$(C++) -o rms $(rmsobj)  $(LOPT) -lstdc++ -ljasper -ltiff

vignette:	$(vignetteobj)
	$(C++) -o vignette $(vignetteobj)  $(LOPT) -lstdc++ -ljasper -ltiff


######################################################
# Some general rules                                 #
######################################################
.c.o:	
	$(CC)  $(COPT) $<

.cpp.o:
	$(C++)  $(COPT) $<

.cc.o:
	$(C++)  $(COPT) $<

dep:	$(CSRC) 
	$(CPP) -M $(IOPT)    $(CSRC) > .depend

clean:
	rm -f *.o  core


ifneq ($(strip $(wildcard .depend)),)
include .depend
endif
















